﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Q.Schedulers
{
    public class WorkItemExecutionException : Exception
    {
        private readonly string _workItemId;
        public string WorkItemIdentifier
        {
            get
            {
                return _workItemId;
            }
        }

        public DateTime SchedulerTime { get; private set; }

        internal WorkItemExecutionException(
            string workItemIdentifier, DateTime time)
            : this(workItemIdentifier, time, String.Empty, null) { }

        internal WorkItemExecutionException(
            string workItemIdentifier, DateTime time, string message)
            : this(workItemIdentifier, time, message, null) { }

        internal WorkItemExecutionException(
            string workItemIdentifier, DateTime time,
            string message, Exception inner)
            : base(message, inner)
        {
            _workItemId = workItemIdentifier;
            SchedulerTime = time;
        }
    }
}
